{extend name="public/layout" /}
{block name="head_css"}
    <link rel="stylesheet" href="/static/home/css/detail.css?v={$version}">
{/block}

{block name="main"}
    <!-- 中间内容区域 -->
    <div class="content-area detail-box">
        <div class="head-line inline-box">
            <div class="left inline-block inline-box">
                <div class="cinfo inline-block">
                    <div class="title">{$vo.title}</div>
                    <div class="number inline-box">
                        <div class="item-box inline-block inline-box">
                            <div class="icon reading inline-block"></div>
                            <div class="words inline-block">{$vo.pv}次</div>
                        </div>
                        <div class="item-box inline-block inline-box">
                            <div class="icon datetime inline-block"></div>
                            <div class="words inline-block">{$vo.update_time}</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="right inline-block inline-box">
                <div class="contract-btn inline-block" onclick="get_mobile(this)">查看联系方式</div>
                <div class="action-box inline-block">
                    <div class="icon share"></div>
                    <div class="name">分享</div>
                </div>
            </div>
        </div>

        <div class="content-wrapper-box">
            {$vo.detail}
        </div>

        {include file='base_message/pic_list'/}

    </div>
    <!-- 中间内容区域 END -->
    <div class="transparent-masker"></div>
    <div class="comment-chosen-img-box">
        <img id="origin-img">
    </div>
{/block}

{block name="script"}
    <script>
        var cname = 'chosen';
        var popCname = 'show';
        var masker = $('.transparent-masker');
        var imgBox = $('.comment-chosen-img-box');

        $('.comment-chosen-pop-box .chosen-box .citem').click(function(e) {
            var _this = $(this);
            if(_this.hasClass(cname)) _this.removeClass(cname);
            else _this.addClass(cname);
        });

        function get_mobile(obj) {
            $(obj).text('{$vo.mobile}');
        }
        window.onload = function(){
            var url = '{:url("add_pv")}';
            var d = new Object();
            d.id = {$vo.id};
            d.seed = '{$seed}';
            $.post(url,d,function(){

            });
        };
        $('.scroll-item').on('click',function(){
            masker.addClass(popCname);
            imgBox.addClass(popCname);
            $(masker).css('background','black');
            $(masker).css('opacity','0.5');
            $('#origin-img').attr('src',$(this).attr('data-url'));
        });
        masker.click(function(e) {
            masker.removeClass(popCname);
            imgBox.removeClass(popCname);
        });
    </script>
{/block}